package com.chdwmp.product.mapper;

import com.chdwmp.product.bean.Product;
import com.chdwmp.product.bean.app.*;
import com.chdwmp.product.bean.backend.AgentVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Auther: LLL
 * @Date: 2021/3/13 21:11
 * @Description:
 */
@Mapper
public interface AppMapper {


    AppSystemInfo selectAppSystemInfo(String imei);

    String selectAppUserPassWord(String imei);

    void updateAppUserPassWord(@Param("imei") String imei, @Param("password") String password);

    void updateAppStatus(@Param("imei") String imei, @Param("status") String status,@Param("ipAddr") String ipAddr);

    String selectAppUserStatus(String imei);

    String selectAppUserIdByImei(String imei);

    List<CameraInfo> selectAppUserCameras(String user_id);

    Equipment queryAppUserSerialNumber(String imei);

    void updateAppUserCameraInfo(EquipmentUpdate equipmentUpdate);

    String selectAppUserCurrentStatus(String imei);

    List<Products> selectProductList();

    List<Products> selectAppUserByProductList(String user_id);

    String selectAppUserByProducts(String imei);

    Products selectProductById(String id);

    String selectSerialNumberIdByCode(String code);

    int addAppSystemInfo(AppSystemInfoAdd appSystemInfoAdd);

    void addAppKeepLived(@Param("imei") String imei,@Param("serialNumber") String serialNumber);

    void deleteAgentProductRelation(@Param("agent_id")Integer agent_id, @Param("product_id")String product_id);

    List<Integer> queryAgentIdByName(String first_class_customer_name);

    List<Product> queryAllProductList();

    List<AgentProductVo> getAgentProductList(Integer id);

    List<AgentVo> getAllAgentList();

    Integer queryAgentBuyProductId(@Param("name") String first_class_customer_name, @Param("productId") String product_id);

    int queryIsExits(@Param("imei") String imei, @Param("serialNumber") String serialNumber);

    void updateAppKeepLived(@Param("imei") String imei, @Param("serialNumber") String serialNumber);

    int queryBuyCount(@Param("productId") String productId, @Param("agentId") Integer agentId);

}
